summaryrefslogtreecommitdiff
path: root/src/pages/blogs/[...slug].astro
blob: dbecb22725321d189b6f14bd997f81dc3149e6e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
import { getCollection } from "astro:content";
import Terminal from "@layouts/Terminal.astro";
import BlogItem from "@components/BlogItem.astro";

export async function getStaticPaths() {
    const blogEntries = await getCollection("blogs");
    return blogEntries.map((entry) => ({
        params: { slug: entry.slug },
        props: { entry },
    }));
}

const { entry } = Astro.props;
const { Content } = await entry.render();
---

<Terminal path="blogs/">
    <div class="w-full h-[65vh] overflow-y-auto pr-4">
        <div class="text-[130%] h-full m-0 p-0">
            <div class="text-[110%]">
                <BlogItem
                    title={entry.data.title}
                    description={entry.data.description ?? ""}
                    date={entry.data.date}
                />
            </div>
            <div class="markdown">
                <h2>Somewhat of a long heading</h2>
                <Content />
            </div>
        </div>
    </div>
</Terminal>

<style is:global>
    .markdown p {
        padding-bottom: 1rem;
    }
    .markdown strong {
        font-weight: bold;
    }
    .markdown h2 {
        color: var(--secondary);
        font-size: 125%;
        padding-bottom: 0.5rem;
    }
    .markdown h3 {
        color: var(--secondary);
        font-size: 110%;
        padding-bottom: 0.25rem;
    }
</style>